<%--
  Created by IntelliJ IDEA.
  User: WDD
  Date: 2019/6/1
  Time: 16:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="stylesheet" href="${APP_PATH }/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="${APP_PATH }/css/font-awesome.min.css">
    <link rel="stylesheet" href="${APP_PATH }/css/theme.css">
    <style>
        #footer {
            padding: 15px 0;
            background: #fff;
            border-top: 1px solid #ddd;
            text-align: center;
        }
    </style>
</head>
<body>
<div class="navbar-wrapper">
    <div class="container">
        <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <a class="navbar-brand" href="index.html" style="font-size:32px;">尚筹网-创意产品众筹平台</a>
                </div>
                <div id="navbar" class="navbar-collapse collapse" style="float:right;">
                    <ul class="nav navbar-nav">
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="glyphicon glyphicon-user"></i> 张三<span class="caret"></span></a>
                            <ul class="dropdown-menu" role="menu">
                                <li><a href="member.html"><i class="glyphicon glyphicon-scale"></i> 会员中心</a></li>
                                <li><a href="#"><i class="glyphicon glyphicon-comment"></i> 消息</a></li>
                                <li class="divider"></li>
                                <li><a href="index.html"><i class="glyphicon glyphicon-off"></i> 退出系统</a></li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
        </nav>

    </div>
</div>

<div class="container theme-showcase" role="main">
    <div class="page-header">
        <h1>实名认证 - 申请</h1>
    </div>

    <ul class="nav nav-tabs" role="tablist">
        <li role="presentation" ><a href="#"><span class="badge">1</span> 基本信息</a></li>
        <li role="presentation" ><a href="#"><span class="badge">2</span> 资质文件上传</a></li>
        <li role="presentation" ><a href="#"><span class="badge">3</span> 邮箱确认</a></li>
        <li role="presentation" class="active"><a href="#"><span class="badge">4</span> 申请确认</a></li>
    </ul>

    <form role="form" style="margin-top:20px;">
        <div class="form-group">
            <label for="authcode">验证码</label>
            <input type="text" class="form-control" id="authcode" placeholder="请输入你邮箱中接收到的验证码">
        </div>
        <button type="button" id="reloadBtn" class="btn btn-primary">重新发送验证码</button>
        <button type="button" id="finishBtn"  class="btn btn-success">申请完成</button>
    </form>
    <hr>
</div> <!-- /container -->
<div class="container" style="margin-top:20px;">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <div id="footer">
                <div class="footerNav">
                    <a rel="nofollow" href="http://www.atguigu.com">关于我们</a> | <a rel="nofollow" href="http://www.atguigu.com">服务条款</a> | <a rel="nofollow" href="http://www.atguigu.com">免责声明</a> | <a rel="nofollow" href="http://www.atguigu.com">网站地图</a> | <a rel="nofollow" href="http://www.atguigu.com">联系我们</a>
                </div>
                <div class="copyRight">
                    Copyright ?2017-2017 wdd.com 版权所有
                </div>
            </div>

        </div>
    </div>
</div>
<script src="${APP_PATH }/jquery/jquery-2.1.1.min.js"></script>
<script src="${APP_PATH }/bootstrap/js/bootstrap.min.js"></script>
<script src="${APP_PATH }/script/docs.min.js"></script>
<script type="text/javascript" src="${APP_PATH }/jquery/layer/layer.js"></script>
<script>

    $(function () {
        $("#reloadBtn").attr('disabled',true);
        var timeEle = $("#reloadBtn")[0],
            count   = 5;
        console.log(timeEle)
        timeEle.innerHTML = "重新发送验证码("+ count+")";
        // 设置计时器
        var judge = setInterval(function() {
            count--;
            if (!count) {
                // 清除计时器
                clearInterval(judge);

            };
            // 标签当中显示时间
            if (!count){
                $("#reloadBtn").attr('disabled',false);
                timeEle.innerHTML = "重新发送验证码";
            }else{
                timeEle.innerHTML = "重新发送验证码("+ count+")";
            }
        }, 1000);
    })


    $('#myTab a').click(function (e) {
        e.preventDefault()
        $(this).tab('show')
    });


    $("#finishBtn").click(function(){
        $.ajax({
            type : "POST",
            url  : "${APP_PATH}/member/finishApply.do",
            data : {
                authcode : $("#authcode").val()
            },
            success : function(result) {
                if ( result.success ) {
                    window.location.href = "${APP_PATH}/member.htm";
                } else {
                    $("#authcode").val("");
                    layer.msg(result.message, {time:1000, icon:5, shift:6});
                }
            }
        });
    });

    $("#reloadBtn").click(function(){
        $.ajax({
            type : "POST",
            url  : "${APP_PATH}/member/reloadEmail.do",
            success : function(result) {
                if ( result.success ) {
                    layer.msg("发送成功", {time:1000, icon:6, shift:6});
                    setTimeout(function () {window.location.reload(); }, 1000);
                }
            }
        });
    });

</script>
</body>
</html>
